/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package lwjglbase;

import java.util.ArrayList;

public class LevelGui extends Sprite{
    final String bgFName = "./sprites/guiBackground.png";
    ArrayList<Button> buttons = new ArrayList<Button>();

    public LevelGui() {
        depth = -.9f; //put it at the back
        initTex(bgFName);
        x = 0;
        y = 0;
        xsize = tex.getImageWidth();
        ysize = tex.getImageHeight();
        setupButtons();
    }
    public void handleClicks(float mx, float my) {
        for (Button button : buttons) {
            button.checkClicked(mx, my);
        }
    }

    @Override
    public void render() {
        super.render();
        for (Button button : buttons) {
            button.render();
        }
    }

    private void setupButtons() {
        buttons.add(new Button("forward.png","forward",40, 120));
        buttons.add(new Button("right.png","right",80, 120));
        buttons.add(new Button("left.png","left",120, 120));
        buttons.add(new Button("push.png","push",160, 120));
        buttons.add(new Button("antig.png","anitg",200, 120));
        buttons.add(new Button("f1.png","f1",240, 120));
        buttons.add(new Button("f2.png","f2",280, 120));
    }
}
